package com.lin.utils.treenode;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/8/2.
 */
@Data
public class FeaturesTreeNode {
    private Integer id;

    private String text;

    private String iconCls;

    @JsonIgnore
    private Integer pid;

    private Attributes attributes;

    private List<FeaturesTreeNode> children;

    public void addChild(FeaturesTreeNode node) {
        if (this.children == null) {
            children = new ArrayList<FeaturesTreeNode>();
            children.add(node);
        } else {
            children.add(node);
        }
    }

    public class Attributes{
        private String url;

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }
    }

}
